package com.lepu.app.fun.hospital;

import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.app.utils.Utils;
import com.core.lib.application.BaseFragmentActivity;
import com.eyzhs.app.R;

public class HospitalExpertInfoActivity extends BaseFragmentActivity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.hospital_expert_info_activity);

		init();
	}

	@Override
	public void onDestroy() { 
		WebView webView = (WebView) findViewById(R.id.webView);
		if (webView != null) {
			try {
				LinearLayout activityLayout = (LinearLayout) findViewById(R.id.activityLayout);
				activityLayout.removeView(webView);

				webView.removeAllViews();
				webView.destroy();
				webView = null;
			} catch (Exception e) {
				android.util.Log.d("错误 220 行", "webview Exception");
			}
		}
		super.onDestroy();
	}

	/**
	 * 添加页面动画，需要重写这个方法，
	 */
	@Override
	public void onBackPressed() {
		finishAnim(R.anim.lib_push_down_up_in, R.anim.lib_push_down_up_out);
	}


	/**
	 * 初始化方法
	 */
	private void init() {
		WebView webView = (WebView) findViewById(R.id.webView);
		Utils.initWebViewSettings(webView, false);
		
		LinearLayout activityLayout = (LinearLayout) findViewById(R.id.activityLayout);
		ImageView imageView = (ImageView) findViewById(R.id.imageView);
		
		Utils.initWebViewSettings(webView, false);
		
		webView.loadUrl("http://dl.eyzhs.com/doctorIntro/index.html");
		
		activityLayout.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				finishAnim(R.anim.lib_push_down_up_in, R.anim.lib_push_down_up_out);
			}
		});
		
		imageView.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				finishAnim(R.anim.lib_push_down_up_in, R.anim.lib_push_down_up_out);
			}
		});
		
	}

}
